package com.xiang.design.factory.client;


import com.xiang.design.factory.Log;
import com.xiang.design.factory.LogFactory;
import org.junit.Test;
import org.springframework.boot.test.context.SpringBootTest;

/**
 * 工厂模式测试
 *
 * @author xiangtianlei@gogpay.cn
 * @date 2022-09-28
 */
@SpringBootTest
public class FactoryModeTest {


    LogFactory logFactory = new LogFactory();

    /**
     * 工厂测试日志
     */
    @Test
    public void testLogFactory() {
        Log local = logFactory.getLog("local");
        local.saveLog();
        Log remote = logFactory.getLog("remote");
        remote.saveLog();
        Log file = logFactory.getLog("file");
        file.saveLog();
    }
}
